import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getwidget/getwidget.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/route/route.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

class RechargeResult extends StatefulWidget {
  const RechargeResult({Key? key}) : super(key: key);

  @override
  State<RechargeResult> createState() => _RechargeResultState();
}

class _RechargeResultState extends State<RechargeResult> {
  List<String> results = ['充值成功', '充值失败'];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: ToolsUtils.getDefaultBrnAppBar(
        '充值结果',
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              padding: const EdgeInsets.only(top: Sizes.default30),
              alignment: Alignment.center,
              child: ToolsUtils.getUrlSvg(
                  'https://cdn7.axureshop.com/demo/1525603/images/转账结果提示-2/u2177.svg',
                  width: Sizes.default80,
                  height: Sizes.default80),
            ),
            Container(
              alignment: Alignment.center,
              padding: const EdgeInsets.only(top: Sizes.default20),
              child: Text(
                '充值失败',
                style: StylesUtils.customTextStyle(
                    fontSize: Sizes.default25, color: ColorsUtils.color333),
              ),
            ),
            Container(
              margin: const EdgeInsets.symmetric(
                  vertical: Sizes.default30, horizontal: Sizes.default20),
              padding: const EdgeInsets.symmetric(vertical: Sizes.default10),
              decoration: BoxDecoration(
                  border: Border(
                      top: BorderSide(color: ColorsUtils.parseColorFromHexString('#D7D7D7')),
                      bottom: BorderSide(color: ColorsUtils.parseColorFromHexString('#D7D7D7')))),
              child: ListBody(
                children: [
                  SizedBox(
                    height: Sizes.default40,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '充值说明',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color333, fontSize: Sizes.default15),
                        ),
                        Text(
                          '支付宝充值',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color797, fontSize: Sizes.default15),
                        )
                      ],
                    ),
                  ),
                  SizedBox(
                    height: Sizes.default40,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '充值金额',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color333, fontSize: Sizes.default15),
                        ),
                        Text(
                          '￥1870',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color797, fontSize: Sizes.default15),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default10),
              height: Sizes.default50,
              child: FractionallySizedBox(
                heightFactor: 0.9,
                widthFactor: 0.8,
                child: GFButton(
                    onPressed: () {
                      Get.offNamedUntil(
                          RouteGet.financeManage, ModalRoute.withName(RouteGet.financeManage));
                      /// Navigator.popUntil(context, ModalRoute.withName(RouteGet.financeManage));
                    },
                    text: '完成',
                    textStyle: StylesUtils.customTextStyle(
                        fontSize: Sizes.default16, color: ColorsUtils.colorFf6),
                    shape: GFButtonShape.pills,
                    type: GFButtonType.outline,
                    size: GFSize.LARGE,
                    color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorFf6)),
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default10),
              child: TextButton(
                  onPressed: () {
                    Get.toNamed(RouteGet.financeRechargeInfo);
                  },
                  child: Text(
                    '查看详情',
                    style: StylesUtils.customTextStyle(
                        color: ColorsUtils.color333, fontSize: Sizes.default15),
                  )),
            )
          ],
        ),
      ),
    );
  }
}
